<template>
  <div class=''>
    <el-form
      ref="form"
      :model="form"
      label-width="80px"
    >
      <el-form-item label="用户名">
        <el-input v-model="form.userName"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          @click="saveSysuser"
        >立即创建</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { saveSysuser } from '@/api/createUser'

export default {
  components: {},
  data () {
    return {
      form: {
        userName: ''
      }
    }
  },
  computed: {},
  methods: {
    saveSysuser () {
      saveSysuser(this.form).then(res => {
        this.$message.success(res)
      }).catch(e => {
        this.$message.error(`error:${e.message}`)
      })
    }
  },
  mounted () {

  }
}
</script>
<style lang='less' scoped>
</style>
